library(shape)
library(foreign)
library(plotrix)

data_for_fig1<-read.dta("~PSRM_REP_DATA_HUBER_TUCKER.dta")
democrat<-subset(data_for_fig1, pid7=="Strong Democrat" | pid7=="Not very strong Democrat" | pid7=="Lean Democrat")
republican<-subset(data_for_fig1, pid7=="Strong Republican" | pid7=="Not very strong Republican" | pid7=="Lean Republican")
trump_state<-subset(data_for_fig1, biden_state==0)
biden_state<-subset(data_for_fig1, biden_state==1)
democrat_in_trump<-subset(data_for_fig1, (pid7=="Strong Democrat" | pid7=="Not very strong Democrat" | pid7=="Lean Democrat") & biden_state==0)
democrat_in_biden<-subset(data_for_fig1, (pid7=="Strong Democrat" | pid7=="Not very strong Democrat" | pid7=="Lean Democrat") & biden_state==1)
republican_in_trump<-subset(data_for_fig1, (pid7=="Strong Republican" | pid7=="Not very strong Republican" | pid7=="Lean Republican") & biden_state==0)
republican_in_biden<-subset(data_for_fig1, (pid7=="Strong Republican" | pid7=="Not very strong Republican" | pid7=="Lean Republican") & biden_state==1)



pdf("~/Figure1_RR.pdf", height=6, width=12)
par(mfrow=c(1,3))
means<-c(  mean(democrat_in_biden$scale_state), mean(democrat_in_trump$scale_state), mean(republican_in_biden$scale_state), mean(republican_in_trump$scale_state), mean(biden_state$scale_state), mean(trump_state$scale_state),  mean(democrat$scale_state)
           , mean(republican$scale_state))

ses<-c(  std.error(democrat_in_biden$scale_state), std.error(democrat_in_trump$scale_state), std.error(republican_in_biden$scale_state), std.error(republican_in_trump$scale_state), std.error(biden_state$scale_state), std.error(trump_state$scale_state),  std.error(democrat$scale_state)
           , std.error(republican$scale_state))

mean_hi<-means+1.97*ses
mean_low<-means-1.97*ses
plot(means, c(1:8), pch=19,ylab="", xlab="Belief Biden Will Win State", xlim=c(0, 1.5), axes=F)
axis(1, at=c(0, .25, .5, .75, 1), labels=c("0.0", "0.25", "0.5", "0.75", "1.0"))
labels<-c(  "Dem in Biden State",  "Dem in Trump State", "Rep in Biden State", "Rep in Trump State", "Biden Won State", "Trump Won State" ,"Democrat", "Republican")
for(i in 1:8){
  segments(mean_hi[i],i,mean_low[i], i, lty=1, cex=1 )
  text(1.1, i, labels[i], cex=.9)
  
}
box()
abline(h=6.5,lty=1 )
abline(h=4.5,lty=1 )
abline(v=.5,lty=2 )
text(.75, 7.5, "+.315")
text(.75, 5.5, "+.383")
text(.75, 3.5, "+.395")
text(.75, 1.5, "+.382")
####Predicted levels for EC


means<-c(  mean(democrat_in_biden$scale_biden, na.rm = T), mean(democrat_in_trump$scale_biden, na.rm=T), mean(republican_in_biden$scale_biden, na.rm=T), mean(republican_in_trump$scale_biden, na.rm=T), mean(biden_state$scale_biden, na.rm=T), mean(trump_state$scale_biden, na.rm=T),  mean(democrat$scale_biden, na.rm=T)
           , mean(republican$scale_biden, na.rm=T))

ses<-c(  std.error(democrat_in_biden$scale_biden, na.rm=T), std.error(democrat_in_trump$scale_biden, na.rm=T), std.error(republican_in_biden$scale_biden, na.rm=T), std.error(republican_in_trump$scale_biden, na.rm=T), std.error(biden_state$scale_biden, na.rm=T), std.error(trump_state$scale_biden, na.rm=T),  std.error(democrat$scale_biden, na.rm=T)
         , std.error(republican$scale_biden, na.rm=T))


mean_hi<-means+1.97*ses
mean_low<-means-1.97*ses
plot(means, c(1:8), pch=19,ylab="", xlab="Belief Biden Will Win EC", xlim=c(0, 1.5), axes=F)
axis(1, at=c(0, .25, .5, .75, 1), labels=c("0.0", "0.25", "0.5", "0.75", "1.0"))
labels<-c( "Dem in Biden State",  "Dem in Trump State","Rep in Biden State", "Rep in Trump State","Trump Won State", "Biden Won State", "Democrat", "Republican")
for(i in 1:8){
  segments(mean_hi[i],i,mean_low[i], i, lty=1, cex=1 )
  text(1.1, i, labels[i], cex=.9)
  
}
box()
abline(h=6.5,lty=1 )
abline(h=4.5,lty=1 )
text(.75, 7.5, "+.388")
text(.75, 5.5, "+.077")
text(.75, 3.5, "+.071")
text(.75, 1.5, "+.026")
abline(v=.5,lty=2 )

####Predicted levels for PV

means<-c(  mean(democrat_in_biden$pop_biden_scale, na.rm = T), mean(democrat_in_trump$pop_biden_scale, na.rm=T), mean(republican_in_biden$pop_biden_scale, na.rm=T), mean(republican_in_trump$pop_biden_scale, na.rm=T), mean(biden_state$pop_biden_scale, na.rm=T), mean(trump_state$pop_biden_scale, na.rm=T),  mean(democrat$pop_biden_scale, na.rm=T)
           , mean(republican$pop_biden_scale, na.rm=T))

ses<-c(  std.error(democrat_in_biden$pop_biden_scale, na.rm=T), std.error(democrat_in_trump$pop_biden_scale, na.rm=T), std.error(republican_in_biden$pop_biden_scale, na.rm=T), std.error(republican_in_trump$pop_biden_scale, na.rm=T), std.error(biden_state$pop_biden_scale, na.rm=T), std.error(trump_state$pop_biden_scale, na.rm=T),  std.error(democrat$pop_biden_scale, na.rm=T)
         , std.error(republican$pop_biden_scale, na.rm=T))

mean_hi<-means+1.97*ses
mean_low<-means-1.97*ses
plot(means, c(1:8), pch=19,ylab="", xlab="Belief Biden Will Win PV", xlim=c(0, 1.5), axes=F)
axis(1, at=c(0, .25, .5, .75, 1), labels=c("0.0", "0.25", "0.5", "0.75", "1.0"))
labels<-c(  "Dem in Biden State",  "Dem in Trump State", "Rep in Biden State", "Rep in Trump State",  "Biden Won State","Trump Won State", "Democrat", "Republican")
for(i in 1:8){
  segments(mean_hi[i],i,mean_low[i], i, lty=1, cex=1 )
  text(1.1, i, labels[i], cex=.9)
  
}
box()

abline(h=6.5,lty=1 )
abline(h=4.5,lty=1 )
text(.75, 7.5, "+.439")
text(.75, 5.5, "+.068")
text(.75, 3.5, "+.097")
text(.75, 1.5, "+.008")
abline(v=.5,lty=2 )
dev.off()
#####Swing States

##Figure A8
data_for_fig1$tossupstate<-0
data_for_fig1$tossupstate[data_for_fig1$state_fixed>=24 & data_for_fig1$state_fixed<=31]<-1
democrat<-subset(data_for_fig1, (pid7=="Strong Democrat" | pid7=="Not very strong Democrat" | pid7=="Lean Democrat") & tossupstate==1)
republican<-subset(data_for_fig1, (pid7=="Strong Republican" | pid7=="Not very strong Republican" | pid7=="Lean Republican") & tossupstate==1 )
trump_state<-subset(data_for_fig1, biden_state==0 & tossupstate==1)
biden_state<-subset(data_for_fig1, biden_state==1 & tossupstate==1)
democrat_in_trump<-subset(data_for_fig1, (pid7=="Strong Democrat" | pid7=="Not very strong Democrat" | pid7=="Lean Democrat") & biden_state==0 & tossupstate==1)
democrat_in_biden<-subset(data_for_fig1, (pid7=="Strong Democrat" | pid7=="Not very strong Democrat" | pid7=="Lean Democrat") & biden_state==1 & tossupstate==1)
republican_in_trump<-subset(data_for_fig1, (pid7=="Strong Republican" | pid7=="Not very strong Republican" | pid7=="Lean Republican") & biden_state==0 & tossupstate==1)
republican_in_biden<-subset(data_for_fig1, (pid7=="Strong Republican" | pid7=="Not very strong Republican" | pid7=="Lean Republican") & biden_state==1 & tossupstate==1)



####Predicted levels for state
pdf("~/FigureA8.pdf", height=6, width=12)
library(shape)
par(mfrow=c(1,3))
means<-c(  mean(democrat_in_biden$scale_state), mean(democrat_in_trump$scale_state), mean(republican_in_biden$scale_state), mean(republican_in_trump$scale_state), mean(biden_state$scale_state), mean(trump_state$scale_state),  mean(democrat$scale_state)
           , mean(republican$scale_state))

ses<-c(  std.error(democrat_in_biden$scale_state), std.error(democrat_in_trump$scale_state), std.error(republican_in_biden$scale_state), std.error(republican_in_trump$scale_state), std.error(biden_state$scale_state), std.error(trump_state$scale_state),  std.error(democrat$scale_state)
         , std.error(republican$scale_state))

means<-c(  .665, .611, .337, .271, .507, .472,  .643, .314)
ses<-c(  .027,  .037,.022, .034,  .022,.027, .022, .024)
mean_hi<-means+1.97*ses
mean_low<-means-1.97*ses
plot(means, c(1:8), pch=19,ylab="", xlab="Belief Biden Will Win State", xlim=c(0, 1.5), axes=F)
axis(1, at=c(0, .25, .5, .75, 1), labels=c("0.0", "0.25", "0.5", "0.75", "1.0"))
labels<-c(  "Dem in Biden State",  "Dem in Trump State", "Rep in Biden State", "Rep in Trump State", "Biden Won State", "Trump Won State" ,"Democrat", "Republican")
for(i in 1:8){
  segments(mean_hi[i],i,mean_low[i], i, lty=1, cex=1 )
  text(1.1, i, labels[i], cex=.6)
  
}
box()
abline(h=6.5,lty=1 )
abline(h=4.5,lty=1 )

text(.75, 7.5, "+.329")
text(.75, 5.5, "+.035")
text(.75, 3.5, "+.066")
text(.75, 1.5, "+.054")
####Predicted levels for EC

means<-c(  mean(democrat_in_biden$scale_biden, na.rm = T), mean(democrat_in_trump$scale_biden, na.rm=T), mean(republican_in_biden$scale_biden, na.rm=T), mean(republican_in_trump$scale_biden, na.rm=T), mean(biden_state$scale_biden, na.rm=T), mean(trump_state$scale_biden, na.rm=T),  mean(democrat$scale_biden, na.rm=T)
           , mean(republican$scale_biden, na.rm=T))

ses<-c(  std.error(democrat_in_biden$scale_biden, na.rm=T), std.error(democrat_in_trump$scale_biden, na.rm=T), std.error(republican_in_biden$scale_biden, na.rm=T), std.error(republican_in_trump$scale_biden, na.rm=T), std.error(biden_state$scale_biden, na.rm=T), std.error(trump_state$scale_biden, na.rm=T),  std.error(democrat$scale_biden, na.rm=T)
         , std.error(republican$scale_biden, na.rm=T))

means<-c(  .616, .631, .273, .25,.470,.472,  0.622, .265)
ses<-c( .032,  .038,.033, .045,.024,.031,  .024, .026)
mean_hi<-means+1.97*ses
mean_low<-means-1.97*ses
plot(means, c(1:8), pch=19,ylab="", xlab="Belief Biden Will Win EC", xlim=c(0, 1.5), axes=F)
axis(1, at=c(0, .25, .5, .75, 1), labels=c("0.0", "0.25", "0.5", "0.75", "1.0"))
labels<-c( "Dem in Biden State",  "Dem in Trump State","Rep in Biden State", "Rep in Trump State", "Biden Won State", "Trump Won State","Democrat", "Republican")
for(i in 1:8){
  segments(mean_hi[i],i,mean_low[i], i, lty=1, cex=1 )
  text(1.1, i, labels[i], cex=.6)
  
}
box()
abline(h=6.5,lty=1 )
abline(h=4.5,lty=1 )
text(.75, 7.5, "+.357")
text(.75, 5.5, "-.002")
text(.75, 3.5, "+.023")
text(.75, 1.5, "-.015")

####Predicted levels for PV

means<-c(  mean(democrat_in_biden$pop_biden_scale, na.rm = T), mean(democrat_in_trump$pop_biden_scale, na.rm=T), mean(republican_in_biden$pop_biden_scale, na.rm=T), mean(republican_in_trump$pop_biden_scale, na.rm=T), mean(biden_state$pop_biden_scale, na.rm=T), mean(trump_state$pop_biden_scale, na.rm=T),  mean(democrat$pop_biden_scale, na.rm=T)
           , mean(republican$pop_biden_scale, na.rm=T))

ses<-c(  std.error(democrat_in_biden$pop_biden_scale, na.rm=T), std.error(democrat_in_trump$pop_biden_scale, na.rm=T), std.error(republican_in_biden$pop_biden_scale, na.rm=T), std.error(republican_in_trump$pop_biden_scale, na.rm=T), std.error(biden_state$pop_biden_scale, na.rm=T), std.error(trump_state$pop_biden_scale, na.rm=T),  std.error(democrat$pop_biden_scale, na.rm=T)
         , std.error(republican$pop_biden_scale, na.rm=T))

mean_hi<-means+1.97*ses
mean_low<-means-1.97*ses
plot(means, c(1:8), pch=19,ylab="", xlab="Belief Biden Will Win PV", xlim=c(0, 1.5), axes=F)
axis(1, at=c(0, .25, .5, .75, 1), labels=c("0.0", "0.25", "0.5", "0.75", "1.0"))
labels<-c(  "Dem in Biden State",  "Dem in Trump State", "Rep in Biden State", "Rep in Trump State",  "Biden Won State","Trump Won State", "Democrat", "Republican")
for(i in 1:8){
  segments(mean_hi[i],i,mean_low[i], i, lty=1, cex=1 )
  text(1.1, i, labels[i], cex=.6)
  
}
box()

abline(h=6.5,lty=1 )
abline(h=4.5,lty=1 )
text(.75, 7.5, "+.421")
text(.75, 5.5, "-.018")
text(.75, 3.5, "+.076")
text(.75, 1.5, "-.001")
dev.off()



##Scatterplot
#Figure2
pdf("~/Figure2.pdf", height=8, width=10)
par(mfrow=c(1,2))
data<-read.csv("~/scatterplot_2_party.csv") 
dat2<-read.csv("~/scatterplot_2_party.csv") 

rownames(data)<-data$X
rownames(dat2)<-dat2$X

###Rescale DC
data[51,4]<-.75
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Confidence Biden Will Win State Coefficient", main="Confident Voters")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.8, font=2, pos=1)
abline(v=0.5, lty=2)
abline(h=0.5, lty=2)
text(.35,.55 , "Trump States, Predicted Biden", cex=0.5, col="purple")
text(.35,.45 , "Trump States, Predicted Trump", cex=0.5, col="red")
text(.65,.45 , "Biden States, Predicted Trump", cex=0.5, col="purple")
text(.65,.55 , "Biden States, Predicted Biden", cex=0.5, col="blue")

data<-read.csv("~/scatterplot_2_party_dks.csv") 
rownames(data)<-data$X
data[51,4]<-.75
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Belief State Will Be Toss-Up Coefficient", main="All Voters")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.8, font=2, pos=1)
abline(v=0.5, lty=2)

dev.off()
#Figure A9

pdf("~/FigureA9.pdf", height=8, width=10)
par(mfrow=c(1,1))
dat2[51,4]<-.75
plot(dat2$Biden_2_party, dat2$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Confidence Biden Will Win State Coefficient", main="Confident Voters")
text( dat2$coefficient~dat2$Biden_2_party, labels=rownames(dat2), cex=0.8, font=2, pos=1)
abline(v=0.5, lty=2)
abline(h=0.5, lty=2)
text(.35,.55 , "Trump States, Predicted Biden", cex=0.5, col="purple")
text(.35,.45 , "Trump States, Predicted Trump", cex=0.5, col="red")
text(.65,.45 , "Biden States, Predicted Trump", cex=0.5, col="purple")
text(.65,.55 , "Biden States, Predicted Biden", cex=0.5, col="blue")
for(i in 1:dim(dat2)[1]){
  segments(dat2$Biden_2_party[i], dat2$ci_low[i],dat2$Biden_2_party[i], dat2$ci_high[i] )
}
dev.off()

###Comparing Republicans and Democrats
#Figure A7
pdf("~/FigureA7.pdf", height=8, width=10)
par(mfrow=c(1,1))
data<-read.csv("~/partisans_by_state.csv")
data$reps<-abs(1-data$reps)
data$reps<-jitter(data$reps, factor=15)
data$dems<-jitter(data$dems, factor=15)
plot(data$dems, data$reps, cex=.5, pch=19, xlab="Democrats Confidence Biden Wins State", ylab="Republicans Confidence Trump Wins State")
text( data$reps~data$dems, labels=data$state, cex=0.4, font=2, pos=1)
dev.off()


###Comparing Republicans and Democrats
##Figure A6
pdf("~/FigureA6.pdf", height=8, width=10)
par(mfrow=c(1,1))
data<-read.csv("~/scatterplot_2_party_less_attuned.csv")
plot(data$coeff_attuned, data$coefficient, cex=.5, pch=19, xlab="Knowledgable Confidence Biden Wins State", ylab="Less Knowledgeable Confidence Biden Wins State")
text( data$coefficient~data$coeff_attuned, labels=data$state, cex=0.4, font=2, pos=1)
abline(a=0, b=1)
dev.off()


###Figure A3
##Scatterplot for attention
pdf("~/FigureA3.pdf", height=8, width=10)
par(mfrow=c(1,1))
data<-read.csv("~/scatterplot_2_party_five_point.csv") 
rownames(data)<-data$X
###Rescale DC
data[51,4]<-.75
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Confidence Biden Will Win State Coefficient", main="")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=.5)
abline(h=2)
text(.35,2.05 , "Trump States, Predicted Biden", cex=0.45, col="purple")
text(.35,1.95 , "Trump States, Predicted Trump", cex=0.45, col="red")
text(.65,1.95 , "Biden States, Predicted Trump", cex=0.45, col="purple")
text(.65,2.05 , "Biden States, Predicted Biden", cex=0.45, col="blue")

dev.off()

###Figure A4

pdf("~/FigureA4.pdf", height=8, width=10)
par(mfrow=c(1,2))
data<-read.csv("~/scatterplot_2_party_saturated_biden.csv") 
rownames(data)<-data$X
###Rescale DC
data[51,4]<-.75
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Confidence Biden Will Win State Coefficient", main="")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=.5)
abline(h=.5)
text(.35,.51 , "Trump States, Predicted Biden", cex=0.45, col="purple")
text(.35,.45 , "Trump States, Predicted Trump", cex=0.45, col="red")
text(.70,.45 , "Biden States, Predicted Trump", cex=0.45, col="purple")
text(.70,.51 , "Biden States, Predicted Biden", cex=0.45, col="blue")

data<-read.csv("~/scatterplot_2_party_saturated_dk.csv") 
rownames(data)<-data$X
data[51,4]<-.75
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Belief State Will Be Toss-Up Coefficient", main="All Voters")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=0.5)

dev.off()

###Figure A5

pdf("~/FigureA5.pdf", height=8, width=10)
par(mfrow=c(1,2))
data<-read.csv("~/scatterplot_2_party_weighted.csv") 
###Rescale DC
data[51,4]<-.75
data<-data[1:51,]
rownames(data)<-data$X
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Confidence Biden Will Win State Coefficient", main="")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=.5)
abline(h=.5)
text(.35,.51 , "Trump States, Predicted Biden", cex=0.45, col="purple")
text(.35,.45 , "Trump States, Predicted Trump", cex=0.45, col="red")
text(.70,.45 , "Biden States, Predicted Trump", cex=0.45, col="purple")
text(.70,.51 , "Biden States, Predicted Biden", cex=0.45, col="blue")

data<-read.csv("~/scatterplot_2_party_weighted_dk.csv") 
data[51,4]<-.75
data<-data[1:51,]
rownames(data)<-data$X
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Belief State Will Be Toss-Up Coefficient", main="All Voters")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=0.5)

dev.off()

#Figure A1
pdf("~/FigureA1.pdf", height=8, width=10)
par(mfrow=c(1,2))
data<-read.csv("~/scatterplot_2_party_ev.csv") 
rownames(data)<-data$X
###Rescale DC
data[51,4]<-.75
data$coefficient<-data$coefficient+.5
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Confidence Biden Will Win EC Coefficient", main="Confident Voters")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=0.5)
abline(h=0.5)
text(.35,.85 , "Trump States, Predicted Biden", cex=0.45, col="purple")
text(.35,.15 , "Trump States, Predicted Trump", cex=0.45, col="red")
text(.65,.15 , "Biden States, Predicted Trump", cex=0.45, col="purple")
text(.65,.85 , "Biden States, Predicted Biden", cex=0.45, col="blue")

data<-read.csv("~/scatterplot_2_party_ev_dk.csv") 
rownames(data)<-data$X
data[51,4]<-.75
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Belief EC Will Be Toss-Up Coefficient", main="All Voters")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=0.5)

dev.off()

#Figure A2
pdf("~/FigureA2.pdf", height=8, width=10)
par(mfrow=c(1,2))
data<-read.csv("~/scatterplot_2_party_pv.csv") 
rownames(data)<-data$X
###Rescale DC
data[51,4]<-.75
data$coefficient<-data$coefficient+.5
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Confidence Biden Will Win PV Coefficient", main="Confident Voters")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=0.5)
abline(h=0.5)
text(.35,.55 , "Trump States, Predicted Biden", cex=0.45, col="purple")
text(.35,.45 , "Trump States, Predicted Trump", cex=0.45, col="red")
text(.65,.45 , "Biden States, Predicted Trump", cex=0.45, col="purple")
text(.65,.55 , "Biden States, Predicted Biden", cex=0.45, col="blue")

data<-read.csv("~/scatterplot_2_party_pv_dk.csv") 
rownames(data)<-data$X
data[51,4]<-.75
plot(data$Biden_2_party, data$coefficient, cex=.5, pch=19, xlab="Biden 2 Party Vote Share", ylab="Belief PV Will Be Toss-Up Coefficient", main="All Voters")
text( data$coefficient~data$Biden_2_party, labels=rownames(data), cex=0.4, font=2, pos=1)
abline(v=0.5)

dev.off()

